package com.wkq.move.module.main.frame.view

import android.widget.RelativeLayout
import com.just.agentweb.AgentWeb
import com.wkq.base.frame.mosby.delegate.MvpView
import com.wkq.lib_base.utlis.StatusBarUtil
import com.wkq.move.R
import com.wkq.move.module.main.ui.activity.WebViewActivity

/**
 *
 * 作者:吴奎庆
 *
 * 时间:2020/5/21
 *
 * 用途:
 */

class WebViewView : MvpView {

    var mActivity: WebViewActivity

    constructor(mActivity: WebViewActivity) {
        this.mActivity = mActivity
    }

    fun initView() {

        StatusBarUtil.setStatusBarWrite(mActivity)
        StatusBarUtil.setColor(
            mActivity,
            mActivity.getResources().getColor(R.color.color_2b2b2b),
            0
        )
        StatusBarUtil.setDarkMode(mActivity)

        mActivity.mAgentWeb = AgentWeb.with(mActivity)
            .setAgentWebParent(mActivity.binding.webRoot, RelativeLayout.LayoutParams(-1, -1))
            .useDefaultIndicator()
            .createAgentWeb()
            .ready()
            .go(mActivity.path)


        mActivity.binding.rlBack.setOnClickListener { mActivity.finish() }

    }


}


